type binop = Add | Sub | Mult | Div | Equal | Neq | Less | Greater | Geq | Leq | And | Or

type uniop = Not

type variable = 
    IdVar of string

type lit = 
    Literal_int of int
  | Literal_bool of bool
  | Literal_float of float
  | Literal_str of string
  | Literal_array of lit list
  | Literal_map of (lit*lit) list
  | Literal_html of (Nethtml.document)

type datatype = 
    Type_int
  | Type_bool
  | Type_float
  | Type_str
  | Type_Array of datatype
  | Type_Map of datatype*datatype
  | Type_html

type expr =
    Literal of lit
  | Arrayref of variable * expr
  | Mapref of variable * expr
  | Arrayassign of variable * expr * expr
  | Mapassign of variable * expr * expr
  | Var of variable
  | Binop of expr * binop * expr
  | Uniop of uniop * expr
  | Assign of variable * expr
  | Call of string * expr list
  | Noexpr

type stmt =
    Block of stmt list
  | Expr of expr
  | Return of expr
  | Use of string
  | Break
  | If of expr * stmt * stmt
  | Foreach of string * string * expr * stmt
  | While of expr * stmt
  | Declare of datatype * string
  | DeclareAssign of datatype * string * expr
  | FuncDecl of string*((datatype*string) list)*datatype*stmt

type program = stmt list
